package cn.edu.athcm.bean;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class TestSet {

    public static void main(String[] args) {
       Set<String> set = new HashSet<String>();
       set.add("黄山");
       set.add("泰山");
       set.add("大蜀山");
       set.add("黄山");
       System.out.println(set);
      //遍历1
       System.out.println("=====1=======");
       for(String s : set){
           System.out.println(s);
       }
       System.out.println("=====2=======");
       set.forEach(System.out::println);
       System.out.println("=====3=======");
       Iterator<String> it = set.iterator();
       while(it.hasNext()){
           System.out.println(it.next());
       }
       
    }

}
